template "Boot Sector FAT16"

// Template by Stefan Fleischmann
// Revised by Paul Mullen 7/14/2000

// Boot sector format for MSDOS 4.0 onwards (incl. Windows 9x)
// To be applied to sector 0 of a FAT16-formatted logical drive.

description "BIOS parameter block (BPB) of a FAT16 partition"
appliesto disk
sector-aligned

requires 0x0	"EB"	// JMP instruction will usually be EB xx 90
requires 0x2	"90"	// (though older drives may use E9 xx xx)
requires 0x1FE "55 AA"

begin
	read-only hex 3 "JMP instruction"	//00
	char[8]	"OEM"								//03
	uint16	"Bytes per sector"			//0B
	uint8		"Sectors per cluster"		//0D
	uint16	"Reserved sectors"			//0E
	uint8		"FATs"							//10
	uint16	"Root entries"					//11
	uint16	"Sectors (under 32 MB)"		//13
	hex 1		"Media descriptor (hex)"	//15
	uint16	"Sectors per FAT"				//16
	uint16	"Sectors per track"			//18
	uint16	"Heads"							//1A
	uint32	"Hidden sectors"				//1C
	uint32	"Sectors (over 32 MB)"		//20
	hex 1		"BIOS drive (HD=8xh)"		//24
	read-only uint8 "(unused)"
	hex 1		"Extended BS (29h)"			//26
	uint32	"Serial number as integer"	//27
	move -4
	hex 4		"Serial number as hex"		//27
	char[11] "Volume label"					//2B
	char[8]	"File system"					//36

	goto		0x1FE
	read-only hex 2 "Signature (55 AA)"
end